package com.bdqn.controller;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
public class configBean {

    @Bean   //添加到Spring的ioc容器中 id为方法名
    @LoadBalanced    //配置负载均衡实现RestTemplate
    public RestTemplate getRestTemplate(){
           return new RestTemplate();
    }

}
